package com.bgIntlgn.client.entity.jishubu;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 图纸信息表
 * 
 * <h1>这个不写导入工具</h1>
 */
@Table(name = "papers", constrain = "")
public class Paper implements Bean {

	/**
	 * 用作文件上传的时作参数映射。后面的值既是属性的java名称
	 */
	public final static String UID = "uid";

	public final static String PaperID = "paper_id";

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('papers_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key")
	private Long id;

	/**
	 * 图号(由用户填入)
	 */
	@Field(name = "paper_id", type = "char(100)", constrain = "not null unique")
	private String paperId;

	/**
	 * 所属零件ID
	 */
	@Field(name = "uid", type = "char(80)", constrain = "not null references element_subversions(uid) on update cascade on delete cascade")
	private String uid;

	/**
	 * 图片二进制数据
	 */
	@Field(name = "data", type = "bytea", constrain = "")
	private byte[] data;

	/**
	 * 文件名
	 */
	@Field(name = "file_name", type = "varchar(255)", constrain = "")
	private String fileName;

	public String getPaperId() {
		return paperId;
	}

	public void setPaperId(String id) {
		this.paperId = id != null ? id.trim() : id;
	}

	public String getUid() {
		return this.uid;
	}

	public void setUid(String uid) {
		this.uid = uid != null ? uid.trim() : null;
	}

	public byte[] getData() {
		return data;
	}

	public void setData(byte[] data) {
		this.data = data;
	}

	public String getFileName() {
		return this.fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
